<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/WEB-INF/jsp/com/include/declare.jspf" %>
<%@ include file="/WEB-INF/jsp/com/include/doctype.jspf" %>

<script type="text/javascript" src="<c:url value='/common/js/jquery-1.7.1.js'/>"></script>
<script type="text/javascript" src="<c:url value='/common/js/jquery-ui-1.8.16.custom.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/common/js/jquery-popup.0.2.js'/>"></script>
<script type="text/javascript" src="<c:url value='/common/js/ajaxupload.js'/>"></script>
<script type="text/javascript" src="<c:url value='/common/js/Common.js'/>"></script>


<script type="text/javascript">
var ids = 0 ;

var done = 0;
var totalSecs = 180;

function SecondPast()
{
    if ( typeof( checkObj ) == "undefined") {
        checkObj = true;
    }
    
    var timerIsd = "";
   
    var timerChk = document.getElementById("timerChk");    
    if(ids < totalSecs){

        ids += 1;   
        

        var times = totalSecs - ids ;
        var mins = Math.floor(times / 60) ;
        var secs = times % 60 ;
        $("#timerMsg").html(" 인증번호 유효시간 : " + mins +"분   " + secs + "초")

        timerId = setTimeout("SecondPast()",1000);
    }
    else{
        $("#timerMsg").html("인증유효 시간이  경과되었습니다. <br>재전송을 요청하시기 바랍니다");
        timerChk.value = "1";
    }
}

$(function(){
    if ( typeof( checkObj ) == "undefined") {
        SecondPast(); 
    }
    
});

/*재전송 요청*/
function reCertFirm(){
  

    cef2PopUp("cef2","cef2");
} 

/* 인증정보 확인요청 */
function CertFirmSubmit()
{

    
    
    var timerChk = document.getElementById("timerChk");    
 
    
    if (timerChk.value == "1"){
       alert("인증시간이 초과되어 인증할수 없습니다. 재전송하시기 바랍니다.");
       return ;
    }

    
    var authNo = document.cert2LvlForm.authNo.value;

    if(authNo == "")   {
        alert("인증번호를 입력하십시요");
        
        return ;
    } 
    
    document.mbrEntForm.authNo.value = document.cert2LvlForm.authNo.value;   
    document.mbrEntForm.ResponseSEQ.value = document.cert2LvlForm.ResponseSEQ.value;   
//alert("123");

   //alert(document.mbrEntForm.ResponseSEQ.value);
    cef3PopUp("cef2","cef3");
}
</script>
</head>
<body>
<form method="post" action="" name="cert2LvlForm" id="cert2LvlForm" onsubmit="return false" >
<input type="hidden" name="ResponseSEQ" value="${mbrInfoVO.responseSEQ}">
<input type="hidden" name="timerChk" id="timerChk" value = "0">
<div id="popup-cef2" class="pop-w635">
    <div id="popup-header">
        <h1><a href="/WEB-INF/index.jsp"><img src="/images/popup/h1_logo.gif" alt="HYUNDAI" /></a></h1>
    </div>
    <div id="popup-contents1">
        <h2 class="tit-type02"><img src="/images/popup/h2_certification.gif" alt="본인/휴대폰 인증" /></h2>
        <p><img src="/images/popup/h2_certification_desc.gif" alt="인증을 위하여 입력된 정보는 인증기간인 NICE신용평가정보㈜에 제공하여 본인/휴대폰 인증을 받으며, 현대자동차 홈페이지는 주민등록번호를 따로 저장하지 않습니다." /></p>

        <div class="certification-form subsection02">
            <div class="boardwrite-wrap02 subsection02">
                <table summary="성명, 주민등록번호, 통신사선택, 휴대폰 번호">
                <caption>인증번호 입력</caption>
                <colgroup>
                    <col width="18%" />
                    <col />
                </colgroup>
                <tbody>
                <tr>
                    <th scope="row"><img src="/images/popup/txt_certification_05.gif" alt="인증번호 입력" /></th>
                    <td class="certification">
                        <input type="text" class="txt" style="width:172px;" name="authNo" id="authNo"/>
                        <input type="image" src="/images/popup/btn_resend.gif" alt="재전송요청" onClick="reCertFirm()" />
                        <em class="valid-time" name="timerMsg" id="timerMsg">인증번호 유효시간 : </em>
                    </td>
                </tr>
                </tbody>
                </table>
            </div>
            <p class="agree-check">SMS 문자로 전송되어진 인증번호를 3분안에 입력하여 주세요. 3분이 초과하면 유효하지 않습니다.</p>
            <div class="btnwrap">
                <a href="javascript:CertFirmSubmit();"><img src="/images/popup/btn_confirm02.gif" alt="확인"  /></a>
            </div>
        </div>

    </div>
</div>
</form>
</body>
</html>